/*******************************************************************************
 * CBPageViewController.h
 * ComicsBlog
 *
 * Adrien Bougouin <adrien.bougouin@gmail.com>
 */

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "../model/CBPage.h"
#import "../view/CBMoreNewsTableViewCell.h"

// home's logo image
#define CBPageHomeImage       @"btn_home.png"
#define CBPageSeparatorImage  @"separator_background.png"
#define CBPageUneLabelImage   @"une_label.png"
#define CBPageNewsLabelImage  @"news_label.png"

// pages' categorie
#define CBPageActusVOCat  1
#define CBPageActusVFCat  2
#define CBPageRDVCat      5
#define CBPageEcransCat   3
#define CBPageGoodiesCat  4
#define CBPageTrashbagCat 6

// graphic configurations
#define CBPageSeparatorHeight 30
#define CBPageUneHeight       140
#define CBPageNewsHeight      72

#define CBPageNumberOfUneNews     5
#define CBPageNumberOfNewsToLoad  20

// titles associated to the categories or to the news view
static NSString *titles[7] = {
  @"Details",
  @"Actus VO",
  @"Actus VF",
  @"Ecrans",
  @"Goodies",
  @"RVD",
  @"Trashbag",
};

@interface CBPageViewController : UINavigationController
                                  <UITableViewDelegate, UITableViewDataSource> {
  @private
    NSUInteger _category;
    BOOL _isLoading;
    CBPage *_page;
    UITableViewCell *_uneSeparator;
    UITableViewCell *_uneItem;
    UITableViewCell *_newsSeparator;
    UITableView *_newsView;
    CBMoreNewsTableViewCell *_moreNewsCell;
}

- (id) initWithCategory:(NSUInteger) category
             homeTarget:(id) homeTarget
           homeSelector:(SEL) homeSelector;
- (void) configureViewWithTitle:(NSString *) title
                     homeTarget:(id) homeTarget
                   homeSelector:(SEL) homeAction;
- (void) pageUpdated;
- (void) pageError;
- (void) reload;
- (void) uneItemSelected:(id) uneItem;

@end

